package com.tsd.core.openweixin.model.wxpay;


import com.tsd.core.openweixin.utils.AdapterCDATA;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;

/**
 * 支付结果通知模型
 *
 * @author wudw
 */
@XmlRootElement(name = "xml")
@XmlAccessorType(XmlAccessType.FIELD)
public class WeixinPayNotifyLog {
    @XmlElement(name = "err_code")
    @XmlJavaTypeAdapter(AdapterCDATA.class)
    String errCode;//错误代码 err_code 否 String(32) 错误码见第 6 节 错误代码
    @XmlElement(name = "err_code_des")
    @XmlJavaTypeAdapter(AdapterCDATA.class)
    String errCodeDes;//描述 err_code_des 否 String(128) 结果信息描述 以
    @XmlElement(name = "openid")
    @XmlJavaTypeAdapter(AdapterCDATA.class)
    String openId;
    //	用户标识 openid 是 String(128) 用户在商户 appid 下的唯一 标识
    @XmlElement(name = "is_subscribe")
    @XmlJavaTypeAdapter(AdapterCDATA.class)
    String isSubscribe;
    //	是否关注公众账 号 is_subscribe 是 String(1) 用户是否关注公众账号，Y关注，N-未关注，仅在公众 账号类型支付有效
    @XmlElement(name = "trade_type")
    @XmlJavaTypeAdapter(AdapterCDATA.class)
    String tradeType;
    //	交易类型 trade_type 是 String(16) JSAPI、NATIVE、MICROPAY、 APP
    @XmlElement(name = "bank_type")
    @XmlJavaTypeAdapter(AdapterCDATA.class)
    String bankType;
    //	付款银行 bank_type 是 String(16) 银行类型，采用字符串类型 的银行标识
    @XmlElement(name = "total_fee")
    @XmlJavaTypeAdapter(AdapterCDATA.class)
    String totalFee;
    //	总金额 total_fee 是 Int 订单总金额，单位为分
    @XmlElement(name = "coupon_fee")
    @XmlJavaTypeAdapter(AdapterCDATA.class)
    String couponFee;
    //	现金券金额 coupon_fee 否 Int 现金券支付金额<=订单总金 额，订单总金额-现金券金额 为现金支付金额
    @XmlElement(name = "fee_type")
    @XmlJavaTypeAdapter(AdapterCDATA.class)
    String feeType;
    //	货币种类 fee_type 否 String(8) 货币类型，符合 ISO 4217 标 准的三位字母代码，默认人 民币：CNY
    @XmlElement(name = "transaction_id")
    @XmlJavaTypeAdapter(AdapterCDATA.class)
    String transactionId;

    //以下字段在 return_code 和 result_code 都为 SUCCESS 的时候有返回
    //	微信支付订单号 transaction_id 是 String(32) 微信支付订单号
    @XmlElement(name = "out_trade_no")
    @XmlJavaTypeAdapter(AdapterCDATA.class)
    String outTradeNo;
    //	商户订单号 out_trade_no 是 String(32) 商户系统的订单号，与请求 一致。
    @XmlElement(name = "attach")
    @XmlJavaTypeAdapter(AdapterCDATA.class)
    String attach;
    //	商家数据包 attach 否 String(128) 商家数据包，原样返回
    @XmlElement(name = "time_end")
    @XmlJavaTypeAdapter(AdapterCDATA.class)
    String timeEnd;
    //	交易状态  SUCCESS—支付成功
//	REFUND—转入退款
//	NOTPAY—未支付
//	CLOSED—已关闭
//	REVOKED—已撤销（刷卡支付）
//	USERPAYING--用户支付中
//	PAYERROR--支付失败(其他原因，如银行返回失败)
//	支付状态机请见下单API页面
    @XmlElement(name = "trade_state")
    @XmlJavaTypeAdapter(AdapterCDATA.class)
    String tradeState;
    //	商家数据包 attach 否 String(128) 商家数据包，原样返回
    @XmlElement(name = "trade_state_desc")
    @XmlJavaTypeAdapter(AdapterCDATA.class)
    String tradeStateDesc;
    @XmlElement(name = "storeId")
    @XmlJavaTypeAdapter(AdapterCDATA.class)
    String storeId;
    @XmlElement(name = "return_code")
    @XmlJavaTypeAdapter(AdapterCDATA.class)
    private String returnCode;//SUCCESS/FAIL 此字段是通信标识，非交易 标识，交易是否成功需要查看 result_code 来判断
    @XmlElement(name = "return_msg")
    @XmlJavaTypeAdapter(AdapterCDATA.class)
    private String returnMsg;//返回信息，如非空，为错误 原因 签名失败 参数格式校验错误
    @XmlElement(name = "appid")
    @XmlJavaTypeAdapter(AdapterCDATA.class)
    private String appId;//是 String(32) 微信分配的公众账号 ID
    @XmlElement(name = "mch_id")
    @XmlJavaTypeAdapter(AdapterCDATA.class)
    private String mchId;//是 String(32) 微信支付分配的商户号
    @XmlElement(name = "nonce_str")
    @XmlJavaTypeAdapter(AdapterCDATA.class)
    private String nonceStr;//是 String(32) 随机字符串，不长于 32 位
    @XmlElement(name = "sign")
    @XmlJavaTypeAdapter(AdapterCDATA.class)
    private String sign;//是 String(32) 签名,详细签名方法见3.2节
    @XmlElement(name = "result_code")
    @XmlJavaTypeAdapter(AdapterCDATA.class)
    private String resultCode;//是 String(16) SUCCESS/FAIL  业务结果
    @XmlElement(name = "prepay_id")
    @XmlJavaTypeAdapter(AdapterCDATA.class)
    private String prepayId;//只在 trade_type 为 NATIVE 时需要填写。此 id 为二维码 中包含的商品 ID，商户自行 维护。
//	支付完成时间 time_end 是 String(14) 支 付 完 成 时 间 ， 格 式 为 yyyyMMddhhmmss，如 2009 年 12 月27日 9点 10分 10 秒表 示为 20091227091010。时区 为 GMT+8 beijing。该时间取 自微信支付服务器 

    public String getReturnCode() {
        return returnCode;
    }


    public void setReturnCode(String returnCode) {
        this.returnCode = returnCode;
    }


    public String getReturnMsg() {
        return returnMsg;
    }


    public void setReturnMsg(String returnMsg) {
        this.returnMsg = returnMsg;
    }


    public String getAppId() {
        return appId;
    }


    public void setAppId(String appId) {
        this.appId = appId;
    }


    public String getMchId() {
        return mchId;
    }


    public void setMchId(String mchId) {
        this.mchId = mchId;
    }


    public String getNonceStr() {
        return nonceStr;
    }


    public void setNonceStr(String nonceStr) {
        this.nonceStr = nonceStr;
    }


    public String getSign() {
        return sign;
    }


    public void setSign(String sign) {
        this.sign = sign;
    }


    public String getResultCode() {
        return resultCode;
    }


    public void setResultCode(String resultCode) {
        this.resultCode = resultCode;
    }


    public String getPrepayId() {
        return prepayId;
    }


    public void setPrepayId(String prepayId) {
        this.prepayId = prepayId;
    }


    public String getTradeType() {
        return tradeType;
    }


    public void setTradeType(String tradeType) {
        this.tradeType = tradeType;
    }


    public String getOpenId() {
        return openId;
    }


    public void setOpenId(String openId) {
        this.openId = openId;
    }


    public String getIsSubscribe() {
        return isSubscribe;
    }


    public void setIsSubscribe(String isSubscribe) {
        this.isSubscribe = isSubscribe;
    }


    public String getBankType() {
        return bankType;
    }


    public void setBankType(String bankType) {
        this.bankType = bankType;
    }


    public String getTotalFee() {
        return totalFee;
    }


    public void setTotalFee(String totalFee) {
        this.totalFee = totalFee;
    }


    public String getCouponFee() {
        return couponFee;
    }

    public void setCouponFee(String couponFee) {
        this.couponFee = couponFee;
    }

    public String getErrCode() {
        return errCode;
    }

    public void setErrCode(String errCode) {
        this.errCode = errCode;
    }

    public String getErrCodeDes() {
        return errCodeDes;
    }

    public void setErrCodeDes(String errCodeDes) {
        this.errCodeDes = errCodeDes;
    }

    public String getFeeType() {
        return feeType;
    }


    public void setFeeType(String feeType) {
        this.feeType = feeType;
    }


    public String getTransactionId() {
        return transactionId;
    }


    public void setTransactionId(String transactionId) {
        this.transactionId = transactionId;
    }


    public String getOutTradeNo() {
        return outTradeNo;
    }


    public void setOutTradeNo(String outTradeNo) {
        this.outTradeNo = outTradeNo;
    }


    public String getAttach() {
        return attach;
    }


    public void setAttach(String attach) {
        this.attach = attach;
    }


    public String getTimeEnd() {
        return timeEnd;
    }


    public void setTimeEnd(String timeEnd) {
        this.timeEnd = timeEnd;
    }


    public String getStoreId() {
        return storeId;
    }


    public void setStoreId(String storeId) {
        this.storeId = storeId;
    }


    public String getTradeState() {
        return tradeState;
    }


    public void setTradeState(String tradeState) {
        this.tradeState = tradeState;
    }


    public String getTradeStateDesc() {
        return tradeStateDesc;
    }


    public void setTradeStateDesc(String tradeStateDesc) {
        this.tradeStateDesc = tradeStateDesc;
    }


}
